<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>会员编号充值</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">编号</label>
        <div class="layui-input-inline">
            <input type="text" id="userNo" name="userNo" placeholder="请输入会员编号" autocomplete="off" class="layui-input">
            <label id="noshow" style="color:red;" class="layui-form-mid"></label>
        </div>
        <input type="hidden" id="userId" value="0" name="userId" placeholder="0" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">金额</label>
        <div class="layui-input-inline">
            <input type="text" id="amount" name="amount" value="0" placeholder="请输入金额" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" id="remark" name="remark" value="系统充值" placeholder="请输入备注" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-back-submit" value="确认">
    </div>
</div>

<script th:src="@{/layui/layui.js}"></script>
<script th:src="@{/layui/jquery.min.js}"></script>
<script th:src="@{/js/Finace/layuiFinace.js}"></script>
<script>
    layui.config({
        base: './' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
    })

    layui.use('form', function(){
        var form = layui.form;

        $(document).on('change','#userNo',function() {
            var getUrl = "/user/JsonUserNo2?userNo=" + $("#userNo").val();
            $.ajax({ url: getUrl,dataType: 'json', async: false,success: function(res){

                    if(res!=null) {
                        $("#userId").val(res.id);
                        $("#noshow").html(res.name);
                    }
                    else
                    {
                        $("#noshow").html("用户不存在!!")
                    }

            }});
        });

        form.render();

    });

</script>
</body>
</html>